package com.swpu.wangsiyi;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class test2 {
    public void test1() {
        System.out.println("Hello World !");
    }
    public static void main(String[] args) {
        public int addMethod()
    {
            var y = 1 + 1;
            return y;
        }
        public int multiMethod(int x)
        {
            var y = x * 2;
            return y;
        }
        public String stringMethod()
    {
            var str = "String 有返回值，没有参数 的方法";
            return str;
        }
        public String stringMethod2(String string) {
            var str = "String 有返回值，有参数 的方法" + string;
            return str;
        }
        public List<String> listMethod() {
            var list = new ArrayList<String>();
            list.add("List - 有返回值，没有参数 的方法");
            return list;
        }
        public List<String> listMethod2(String name) {
            var list = new ArrayList<String>();
            list.add(name);
            return list;
        }
        public Map<String, Object> mapMethod() {
            var map = new HashMap<String, Object>();
            map.put("身份证", "131231231231231321");
            return map;
        }
        public Map<String, Object> mapMethod2(String name) {
            var map = new HashMap<String, Object>();
            map.put("名称", name);
            return map;
        }
        public Object objectMethod() {
            var name = "WEI_YU";
            return name;
        }
        public Object objectMethod2(String name) {
            var age = 24;
            return "名称: " + name + " & age: " + age;
        }
    }
}
